
********************************************************************************
	
set more off 
clear
capture log close
log using "Updated Tables 1", replace 

********************************************************************************

*     ***************************************************************** *;
*     ***************************************************************** *;
*       File-Name:      updatedtable1.do                                *;
*       Date:           3/31/18                                         *;
*       Author:         YN                                              *;
*       Purpose:        Do-file for updating tables 1 in "FDI,          *;
*                       Poverty, and Access to Potable Water in         *;
*						Developing Countries" Paper                     *;
*       Input File:     India_timeseries_final _with ipolate and sv.dta *;
*       Output File:    Updated Tables 1.log                            *;
*       Data Output:    LaTeX                                           *;
*       Previous file:  Access to Water_ all models.do                  *;
*       Machine:        Mac                                             *;
*     ****************************************************************  *;
*     ****************************************************************  *;

 use "India_timeseries_final _with ipolate and sv.dta"
 *Access to Water
xi: xtpcse _growthhhldwithaccesstowater  _diiiiasageofgdpallinclusiverscr, pairwise corr (psar1)
	eststo c1
xi: xtpcse _growthhhldwithaccesstowater _fdiiiasageofgdpreliablerscrore _diiiiasageofgdpallinclusiverscr _i2percentageofscst, pairwise corr (psar1)
	eststo c2
xi: xtpcse _growthhhldwithaccesstowater _fdiiiasageofgdpreliablerscrore  _popgrowth _lnurban _lnpercapitagdpcurrent19992000 _diiiiasageofgdpallinclusiverscr _growthgsdpatcurrentprices _i2percentageofscst _l2fdigdpreliablei2percentscst _lngross_cropped_area excess_rainfall_20pct  i.id i.year, pairwise corr (psar1)
	eststo c3
xi: xtpcse _growth_urban_accesstowater _fdiiiasageofgdpreliablerscrore  _popgrowth _lnurban _lnpercapitagdpcurrent19992000 _diiiiasageofgdpallinclusiverscr _growthgsdpatcurrentprices _i2percentageofscst _l2fdigdpreliablei2percentscst _lngross_cropped_area excess_rainfall_20pct  i.id i.year, pairwise corr (psar1)
	eststo c5
*Water Expenditure- Policy Response
xi: xtpcse _waterexpenditureasageofgdp _fdiiiasageofgdpreliablerscrore  _lnurban _popgrowth _lnpercapitagdpcurrent19992000 _diiiiasageofgdpallinclusiverscr _growthgsdpatcurrentprices _i2percentageofscst _l2fdigdpreliablei2percentscst _lngross_cropped_area excess_rainfall_20pct  i.id i.year, pairwise corr (psar1)
	eststo c6
*ADD
xi: xtpcse _grwthaddcases _healthexpenditureasageofgdp _fdiiiasageofgdpreliablerscrore  _i2percentageofscst     _diiiiasageofgdpallinclusiverscr, pairwise corr(psar1)
	eststo c7
xi: xtpcse _grwthaddcases _healthexpenditureasageofgdp  _fdiiiasageofgdpreliablerscrore _diiiiasageofgdpallinclusiverscr _i2percentageofscst _l2fdigdpreliablei2percentscst _popgrowth _lnurban _growthgsdpatcurrentprices   _lnpercapitagdpcurrent19992000 excess_rainfall_20pct i.id dummy19962000 dummy20012004, pairwise corr(psar1)
	eststo c8
*Urban and Gini
 xi: xtpcse _growth_urban_accesstowater _Fdiiiasageofgdpreliablerscrore  _popgrowth _lnurban _lnpercapitagdpcurrent19992000 _Diiiiasageofgdpallinclusiverscr _Growthgsdpatcurrentprices _giniurban _lfdigdpreliablel2giniurban _lngross_cropped_area excess_rainfall_20pct  i.id i.year, pairwise corr (psar1)
	eststo c4

estout c1 c2 c3 c4 c5 c6 c7 c8 ///
				using "RA_Updated_Table_1.txt", replace label delimiter(_tab) noabbrev ///
				cells(b(star fmt(%9.4f)) p(par abs fmt(3))) style(fixed) starlevels(* 0.10 ** 0.05 *** 0.01) ///
				stats(N r2, labels("N" "R-squared") ///
				fmt(0 2)) order(_fdiiiasageofgdpreliablerscrore _popgrowth _lnurban ///
				_lnpercapitagdpcurrent19992000 _diiiiasageofgdpallinclusiverscr _growthgsdpatcurrentprices _i2percentageofscst ///
				_l2fdigdpreliablei2percentscst _lngross_cropped_area excess_rainfall_20pct _lfdigdpreliablel2giniurban _giniurban _healthexpenditureasageofgdp) ///
				mlabels("(1)" "(2)" "(3)" "(4)" "(5)" "(6)" "(7)" "(8)")
			

